const formatDateText = (time, type) => {
	time = time.replace(/-/g, '/')
	const date = new Date(type == 'number' ? Number(time) : time)
	const Y = date.getFullYear()
	const M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
	const D = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
	return `${Y}年${M}月${D}日`
}
const formatDateMMDD=(time)=>{
	time = time.replace(/-/g, '/')
	const date = new Date(time)
	const Y = date.getFullYear()
	const M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
	const D = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
	return `${M}.${D}`
}
const formatDateWeek = (time, type) => {
	time = time.replace(/-/g, '/')
	const date = new Date(type == 'number' ? Number(time) : time)
	const count = date.getDay()
	let text;
	switch (count) {
		case 0:
			text = '周日'
			break
		case 1:
			text = '周一'
			break
		case 2:
			text = '二'
			break
		case 3:
			text = '周三'
			break
		case 4:
			text = '周四'
			break
		case 5:
			text = '周五'
			break
		case 6:
			text = '周六'
			break
	}
	return text
}
export {
	formatDateText,
	formatDateWeek,
	formatDateMMDD
}